Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jul 8, 2025

This PR implements the requested feature to return an error if the model tries to attempt completion with incomplete todos.

Changes

  • Added validateTodosForCompletion function to check for incomplete todos
  • Modified attemptCompletionTool to validate todos before allowing completion
  • Block completion when todos have pending or in_progress status
  • Provide detailed error messages showing which specific todos are incomplete
  • Added comprehensive test coverage for both validation logic and integration

Testing

  • All existing tests pass (103/103)
  • New validation function tests (7/7)
  • New attempt completion integration tests (5/5)
  • Type checking passes
  • Linting passes

Resolves the Slack mention request from @U08ELT3D32A to prevent completion with incomplete todos.


Important

Adds validation to block task completion if todos are incomplete, with tests and error messages.

  • Behavior:
    • Adds validateTodosForCompletion in updateTodoListTool.ts to check todos' completion status.
    • Modifies attemptCompletionTool in attemptCompletionTool.ts to use validateTodosForCompletion before allowing task completion.
    • Blocks task completion if any todos are pending or in_progress, providing detailed error messages.
  • Testing:
    • Adds tests for validateTodosForCompletion in updateTodoListTool.spec.ts.
    • Adds tests for attemptCompletionTool in attemptCompletionTool.spec.ts to ensure completion is blocked with incomplete todos.
  • Misc:
    • Resolves a Slack request to prevent task completion with incomplete todos.

This description was created by Ellipsis for 97987f3. You can customize this summary. It will automatically update as commits are pushed.

- Add validateTodosForCompletion function to check for incomplete todos
- Modify attemptCompletionTool to validate todos before allowing completion
- Block completion when todos have 'pending' or 'in_progress' status
- Provide detailed error messages showing which todos are incomplete
- Add comprehensive test coverage for validation logic
- Maintain existing functionality when no todos exist

Resolves Slack request to prevent completion with incomplete todos
@roomote roomote requested review from cte, jr and mrubens as code owners July 8, 2025 01:27
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 8, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 8, 2025

No security or compliance issues detected. Reviewed everything up to 97987f3.

Security Overview
  • 🔎 Scanned files: 4 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► attemptCompletionTool.ts
    Add todo validation before task completion
► updateTodoListTool.ts
    Implement validateTodosForCompletion function
► attemptCompletionTool.spec.ts
    Add test coverage for todo validation
► updateTodoListTool.spec.ts
    Add test coverage for validateTodosForCompletion

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.


// If there are any incomplete todos, block completion
if (pendingTodos.length > 0 || inProgressTodos.length > 0) {
let errorMessage = "Cannot attempt completion while there are incomplete todos:\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-facing error messages (e.g. in validateTodosForCompletion) are hardcoded. It is recommended to use the internationalization function to support translations consistently.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 8, 2025
@mrubens mrubens closed this Jul 8, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 8, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants